﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/psufool.js"></script>
<script type="text/javascript" src="js/shieldMouse.js"></script>
</head>

<body>
	<table cellpadding="0" cellspacing="1" border="0" class="login-container">
    	<form name="loginForm" id="loginForm" action="">
    	<tr>
        	<td class="guid">用户名：</td>
            <td><input type="text" name="userName" id="userName" class="inputTxt" /></td>
        </tr>
    	<tr>
        	<td class="guid">密　码：</td>
            <td><input type="password" name="password" id="password" class="inputTxt" /></td>
        </tr>
    	<tr>
        	<td class="guid">验证码：</td>
            <td>
            	<table cellpadding="0" cellspacing="0" border="0" width="100%">
                	<tr>
                    	<td width="40%"><input type="text" name="chkCode" id="chkCode" maxlength="6" class="inputTxt" /></td>
                        <td><span id="codeStr" class="pointer">单击获取验证码！</span></td>
                  </tr>
                </table>
            </td>
        </tr>
        </form>
    </table>
</body>
</html>
<script type="text/javascript">
var dg = frameElement.lhgDG;
$(function(){
	dg.addBtn('login','登 陆',loginSub);
	dg.addBtn('goHomePage','返回首页',goHomePage);
	
	var codeStr = "单击获取验证码！";
	$("input[name='chkCode']").focus(function(){
		$(this).val("");
		var objCode = $("#codeStr");
		if(objCode.html()==codeStr){
			getCode();
		}
	});
	$("#userName").focus();
	$("#codeStr").click(getCode);
});

var loginSub = function(){
	if($("#userName").val().length==0){
		$("#userName").focus();
		alert("对不起，请输入用户名！");
		return false;
	}
	if($("#password").val().length==0){
		$("#password").focus();
		alert("对不起，请输入密码！");
		return false;
	}
	if($("#chkCode").val().length==0){
		$("#chkCode").focus();
		alert("请输入右侧的验证码！");
		return false;
	}
}

var goHomePage = function(){
	gotoLocation('/','_top');
}

var getCode = function() {
		var Dv_CodeFile = "";
		Dv_CodeFile = "";
		$("#codeStr").html('<img src="'+Dv_CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" title="点击刷新验证码" onclick="this.src=\''+Dv_CodeFile+'?t=\'+Math.random()" valign=\'absmiddle\' />');
	};
</script>